﻿/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header样式 */
header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 0.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    line-height: 1;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 0.5rem;
    transition: all 0.3s ease;
    width: 380px;
    height: 36px;
    border: 2px solid transparent;
}

    .search-container:focus-within {
        background: rgba(255, 255, 255, 0.25);
        border-color: rgba(255, 255, 255, 0.5);
    }

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: white;
    padding: 0.4rem 1rem;
    font-size: 0.95rem;
    outline: none;
}

    .search-input::placeholder {
        color: rgba(255, 255, 255, 0.7);
    }

.search-button {
    background: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6a11cb;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

    .search-button:hover {
        transform: scale(1.05);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

.clear-search {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

    .nav-links a {
        color: white;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        transition: opacity 0.3s;
        font-size: 0.95rem;
        padding: 0.3rem 0.5rem;
    }

        .nav-links a:hover {
            opacity: 0.8;
        }

/* 主内容区样式 */
.container {
    display: flex;
    width: 100%;
    margin: 2rem 0;
    padding: 0;
    gap: 2rem;
    flex: 1;
    align-items: flex-start;
}

/* 侧边栏样式 - 独立滚动 */
.sidebar {
    width: 250px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    height: calc(100vh - 120px);
    flex-shrink: 0;
    margin-left: 1.5rem;
    position: sticky;
    top: 90px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #6a11cb #f0f0f0;
}

    .sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 3px;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background-color: #6a11cb;
        border-radius: 3px;
    }

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
}

.category-list {
    list-style: none;
}

    .category-list li {
        margin-bottom: 0.5rem;
    }

    .category-list a {
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
        text-decoration: none;
        color: #555;
        border-radius: 8px;
        transition: all 0.3s;
        cursor: pointer;
    }

        .category-list a:hover {
            background: #f0f5ff;
            color: #2575fc;
        }

        .category-list a.active {
            background: #e6f7ff;
            color: #1890ff;
            font-weight: 500;
        }

.icon {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* 内容区样式 */
.content {
    flex: 1;
    min-width: 0;
    padding-right: 1.5rem;
    width: calc(100% - 250px - 3rem);
    overflow-y: auto;
}

.tools-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    width: 100%;
}

.tools-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tools-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.search-info {
    color: #666;
    font-size: 0.9rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    width: 100%;
}

.tool-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #fafafa;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    border: 1px solid #eee;
}

    .tool-item:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
        border-color: #6a11cb;
    }

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

    .tool-icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.tool-info {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.tool-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-description {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 3rem;
    color: #999;
}

    .no-results i {
        font-size: 3rem;
        margin-bottom: 1rem;
        color: #ddd;
    }

/* 响应式设计 */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        padding: 0 1.5rem;
    }

    .sidebar {
        position: static;
        height: auto;
        max-height: 300px;
        margin-left: 0;
        margin-bottom: 1.5rem;
        width: 100%;
    }

    .content {
        width: 100%;
        padding-right: 0;
    }

    .header-container {
        flex-wrap: wrap;
    }

    .search-container {
        order: 3;
        width: 100%;
        margin-top: 1rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
